package com.zjg;
import java.io.Serializable;
import java.util.Map;

//Double Checked locking
public class SingletonByDCL
{
    private Map<Integer, String> configMap;
    private volatile static SingletonByDCL instance = null;

    private SingletonByDCL(Map<Integer, String> configMap)
    {
	this.configMap = configMap;
    }

    public static SingletonByDCL getInstance()
    {
	SingletonByDCL inst = instance;
	if (null == inst)
	{
	    synchronized (SingletonByDCL.class)
	    {
		inst = instance;
		if (null == inst)
		{
		    inst = new SingletonByDCL(ConfigReader.configMap);
		    instance = inst;
		}
	    }
	}
	return inst;
    }
}
